package main.java;


import java.awt.*;

public class Explode {
    public static int WIDTH = ResourceMgr.getInstance().getExplodes()[0].getWidth();
    public static int HEIGHT = ResourceMgr.getInstance().getExplodes()[0].getHeight();
    private int x, y;
    private boolean isAlive = true;
    private int step = 0;
    TankFrame tf = null;

    public Explode(int x, int y, TankFrame tf) {
        this.x = x;
        this.y = y;
        this.tf = tf;
    }
    public void paint(Graphics g) {
        g.drawImage(ResourceMgr.getInstance().getExplodes()[step++], x, y, null);
        if(step >= ResourceMgr.getInstance().getExplodes().length) {
            step = 0;
            tf.explodes.remove(this);
        }
    }

}
